<?php

namespace Home\Controller;

use Think\Page;
use Think\Verify;
class IndexController extends BaseController {
    

    public function index(){
    
        $oid = I('oid');
        if($oid){
            session('openid',$oid);
        }
    
        $openid = session('openid');
        if(is_weixin() == true &&  !$openid && !$oid){

            $urlurl  = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
            $urlurl = urlencode($urlurl);
    
            $url = "http://c3w.cc/entry/click?ReturnUrl=".$urlurl;
            header("Location:".$url);
            exit;
        }


        // 如果是手机跳转到 手机模块
        // if(true == isMobile()){
        //     header("Location: ".U('Mobile/Index/index'));
        //     exit;
        // }
        
        $this->redirect('home/yuanxiao/index');
       
        //$this->display();
    }
 
}